<template>
  <a-tag :color="color">{{ label }}</a-tag>
</template>

<script>
import orderDict from "@/dict/order";

export default {
  props: {
    flag: {
      type: Number
    }
  },
  computed: {
    // 标签颜色
    color() {
      let res =
        this.flag === orderDict.dealStatus.all.value
          ? "green"
          : this.flag === orderDict.dealStatus.part.value
          ? "orange"
          : "";
      return res;
    },
    // 标签文案
    label() {
      let res = this.$getEnum(orderDict.dealStatus, this.flag);
      return res;
    }
  }
};
</script>
